package com.zmj.sy.mom.srv.aps.controller;

import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseListResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.senspermission.SensPermissionEditReqVo;
import com.zmj.sy.mom.srv.aps.bean.vo.senspermission.SensPermissionReqVo;
import com.zmj.sy.mom.srv.aps.bean.vo.senspermission.SensPermissionResVo;
import com.zmj.sy.mom.srv.aps.service.SensPermissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RequiredArgsConstructor
@Api(tags = "权限操作——角色绑定")
@RestController
@RequestMapping("/sensPermission")
public class SensPermissionController {

    private final SensPermissionService sensPermissionService;

    // 查询，修改
    @ApiOperation("权限操作查询")
    @GetMapping("/getSensPermission")
    public BaseListResVo<SensPermissionResVo> getSensPermission(SensPermissionReqVo reqVo){
        return sensPermissionService.getSensPermission(reqVo);
    }

    @ApiOperation("权限操作修改")
    @PostMapping("/editSensPermission")
    public BaseResVo editSensPermission(@RequestBody SensPermissionEditReqVo reqVo){
        sensPermissionService.editSensPermission(reqVo);
        return BaseResVo.ok();
    }

}
